#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<math.h>
int main()
{
	int i = 0;
	int j = 1;
	int n = 0;
	scanf("%d", &n);
	if (n == 1)
	{
		printf("NO\n");
	}
	else if (n == 2)
	{
		printf("YES\n");
	}
	else
	{
		for (i = 2; i <= sqrt(n); i++)
		{
			if (n % i == 0)
			{
				j = 0;
			}
		}
		if (j == 1)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
	}
	return 0;
}